﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:controls="clr-namespace:ColorPickerLib.Controls"
                    >
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="VerticalSlideThumbTemplate.xaml" />
        <ResourceDictionary Source="SliderRepeatButtonStyle.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!-- =============================================================================== -->
    <!-- ColorSpectrumSlider (Template and Style)                                        -->
    <!-- =============================================================================== -->

    <ControlTemplate x:Key="ColorSpectrumSliderTemplate" TargetType="{x:Type controls:ColorSpectrumSlider}">
        <Grid>
            <Border BorderBrush="{TemplateBinding BorderBrush}"
                     BorderThickness="{TemplateBinding BorderThickness}"
                     Margin="0,0,0,0">
                <Border x:Name="PART_TrackBackground" Width="25">
                    <Rectangle x:Name="PART_SpectrumDisplay" Stretch="Fill" VerticalAlignment="Stretch" />
                </Border>
            </Border>

            <Track Name="PART_Track">
                <Track.DecreaseRepeatButton>
                    <RepeatButton Style="{StaticResource SliderRepeatButtonStyle}" Command="Slider.DecreaseLarge" />
                </Track.DecreaseRepeatButton>
                <Track.IncreaseRepeatButton>
                    <RepeatButton Style="{StaticResource SliderRepeatButtonStyle}" Command="Slider.IncreaseLarge" />
                </Track.IncreaseRepeatButton>
                <Track.Thumb>
                    <Thumb Style="{StaticResource VerticalSlideThumbStyle}" />
                </Track.Thumb>
            </Track>
        </Grid>
    </ControlTemplate>

    <Style TargetType="{x:Type controls:ColorSpectrumSlider}">
        <Setter Property="BorderBrush" Value="DarkGray" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Orientation" Value="Vertical" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
        <Setter Property="Minimum" Value="0" />
        <Setter Property="Maximum" Value="360" />
        <Setter Property="TickFrequency" Value="0.001" />
        <Setter Property="IsSnapToTickEnabled" Value="True" />
        <Setter Property="IsDirectionReversed" Value="False" />
        <Setter Property="IsMoveToPointEnabled" Value="True" />
        <Setter Property="Value" Value="0" />
        <Setter Property="Template" Value="{StaticResource ColorSpectrumSliderTemplate}" />
    </Style>

</ResourceDictionary>